package com.fau.wm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * @desc 储位-层表
 * @author liy
 * @datetime 2014年7月27日,下午4:24:04
 */
@Entity
@Table(name = "medical_shelf_layer")
public class MedicalShelfLayer implements Serializable {

	private static final long serialVersionUID = 5775770312944616384L;

	private String id;
	private String layerNum;		// 层数
	private String shelfId;			// 货架id
	private MedicalShelf shelf;
	
	public MedicalShelfLayer(){}
	
	public MedicalShelfLayer(String layerNum,MedicalShelf shelf) {
		this.layerNum = layerNum;
		this.shelf = shelf;
	}
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "layer_num", length = 30)
	public String getLayerNum() {
		return layerNum;
	}

	public void setLayerNum(String layerNum) {
		this.layerNum = layerNum;
	}

	@Transient
	public String getShelfId() {
		return shelfId;
	}

	public void setShelfId(String shelfId) {
		this.shelfId = shelfId;
	}

	@ManyToOne
	@JoinColumn(name = "shelf_id")
	public MedicalShelf getShelf() {
		return shelf;
	}

	public void setShelf(MedicalShelf shelf) {
		this.shelf = shelf;
	}
	
}